package com.bsdsma.fengheguaiapp.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色枚举
 */
@Getter
@AllArgsConstructor
public enum Role {

    SUPER_ADMIN(0, "超级管理员"),
    ADMIN(1, "管理员"),
    USER(2, "普通用户"),
    PARTNER(3, "合作商"),
    ;

    private Integer value;
    private String desc;

    public static Role get(Integer role){
        for(Role item : values()){
            if(item.getValue().equals(role)){
                return item;
            }
        }
        return null;
    }
}
